import req from '@/utils/request.js';
import * as URL from '@/constants/api.js';

export function getShoppingCartList() {
  return req({
    url: URL.SHOPPING_CART,
  })
    .then((res) => res.data.result)
    .catch(() => []);
}

export function updateShoppingCartMember(id, selected) {
  return req({
    url: `${ URL.SHOPPING_CART }/${ id }`,
    method: 'put',
    data: {
      selected,
    },
  });
}
